/**
 * OrderDao.java
 * 
 * Copyright@2015 OVT Inc. All rights reserved. 
 * 
 * 2015年12月21日
 */
package com.ovt.order.dao;

import java.util.List;

import com.ovt.order.dao.contant.OrderState;
import com.ovt.order.dao.vo.Order;

/**
 * OrderDao
 * 
 * @Author brad.zhou
 * @Version 1.0
 * @See
 * @Since [OVT Cloud Platform]/[API] 1.0
 */
public interface OrderDao
{
    /**
     * Add a new order.
     * 
     * @param order
     * @return Order
     */
    public long saveOrder(Order order);

    /**
     * Get order's list by userId.
     * 
     * @param userId
     * @return List<Order>
     */
    public List<Order> getOrderList(long userId);

    /**
     * Get a order's detail information by orderNo.
     * 
     * @param orderNo
     * @return Order
     */
    public Order getOrderInfo(String orderNo);

    /**
     * Update a order's state.
     * 
     * @param orderNo
     * @param state
     * @return int
     */
    public OrderState updateOrderState(String orderNo, OrderState state);

    /**
     * Update order's deleteFlag.
     * 
     * @param orderNo
     * @param flag
     * @return int
     */
    public int updateOrderDeleteFlag(String orderNo, int flag);
}
